#include<stdio.h>
#include<conio.h>
#include<graphics.h>
int main() {
	float Pi = 3.1415;
	float cx = 125;
	float cy = 125;
	float cr = 125;
	int i = 1;
	float left = cx - cr;
	float top = cy - cr;
	float right = cx + cr;
	float bottom = cy + cr;
	float rad = 0;
	initgraph(1000, 1000);
	while (1) {
		COLORREF color;
		float v = rand() % 360;
		color = HSVtoRGB(v, 1, 1);
		setbkcolor(color);
		cleardevice();
		for (cy = 125; cy <= 875; cy = cy + 250){
			for (cx = 125; cx <= 875; cx = cx + 250){
				for (cr = 125; cr > 0; cr = cr - 25){
					float z = rand() % 180;
					COLORREF color1;
					COLORREF color2;
					color1 = HSVtoRGB(z, 1, 1);
					color2 = HSVtoRGB(z + 180, 1, 1);
					for (i = 1; i <= 45; i++){
						float left = cx - cr;
						float top = cy - cr;
						float right = cx + cr;
						float bottom = cy + cr;
						setfillcolor(color1);
						solidpie(left, top, right, bottom, 0 + rad, 3 * Pi / 60 + rad);
						setfillcolor(RGB(255, 255, 255));
						solidpie(left, top, right, bottom, 3 * Pi / 60 + rad, 4 * Pi / 60 + rad);
						setfillcolor(color2);
						solidpie(left, top, right, bottom, 4 * Pi / 60 + rad, 7 * Pi / 60 + rad);
						setfillcolor(RGB(0, 0, 0));
						solidpie(left, top, right, bottom, 7 * Pi / 60 + rad, 8 * Pi / 60 + rad);
						rad = rad + 8 * Pi / 60;
					}
					i = 1;
					rad = rad + 3 * Pi / 60;
				}
				cr = 125;
			}
			cx = 125;
		}
		_getch();
	}
	return 0;
}